package com.example.study.model;

import com.example.study.model.group.Insert;
import com.example.study.model.group.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import javax.validation.constraints.*;
import java.io.Serializable;

@Data
@EqualsAndHashCode()
@ToString
public class TeacherVO implements Serializable {
    @NotNull(groups = {Update.class}, message = "老师ID不能为空")
    private Long id;
    @NotNull(groups = {Insert.class}, message = "课程ID不能为空")
    @ApiModelProperty(value = "课程ID")
    private Long courseId;
    @NotNull(groups = {Insert.class}, message = "班级ID不能为空")
    @ApiModelProperty(value = "班级ID")
    private Long classId;
    @NotBlank(groups = {Insert.class}, message = "老师姓名不能为空")
    @ApiModelProperty(value = "老师姓名")
    private String teacherName;
    //Swagger的枚举类型
    @NotNull(groups = {Insert.class}, message = "老师性别不能为空")
    @ApiModelProperty(value = "老师性别(0:男 1:女)", allowableValues = "0,1")
    private Integer teacherSex;
    @NotBlank(groups = {Insert.class}, message = "老师手机号不能为空")
    @Pattern(groups = {Insert.class}, regexp = "^1\\d{10}$",message = "不满足手机号正则表达式")
    @ApiModelProperty(value = "老师手机号")
    private String teacherMobile;
    @NotBlank(groups = {Insert.class}, message = "老师邮箱不能为空")
    @Pattern(groups = {Insert.class}, regexp = "^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\\.[a-zA-Z0-9]{2,6}$",message = "不满足邮箱正则表达式")
    @ApiModelProperty(value = "老师邮箱")
    private String teacherEmail;
    @ApiModelProperty(value = "老师状态")
    private Integer status;
}
